package com.example.springcloud.serivce.impl;

import com.example.springcloud.dao.PaymentDao;
import com.example.springcloud.entity.Payment;
import com.example.springcloud.serivce.PaymentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@Service
@RequiredArgsConstructor
public class PaymentServiceImpl implements PaymentService {
    private final PaymentDao paymentDao;

    @Override
    public int create(Payment payment) {
        return paymentDao.save(payment);
    }

    @Override
    public Payment findById(Long id) {
        return paymentDao.getPaymentById(id);
    }
}
